function forEachViewport(callback) {
    //增加选中状态
    var elements = $('div.active').find('.viewportWrapperSelect').find('.viewport');
    //var elements = $('.viewportWrapperSelect').find('.viewport');

    //console.log('elements:',elements.length);
    if (elements.length==0)
    {
        var elements = elements = $('div.active').find('.viewport')
    }
    $.each(elements, function(index, value) {
        var element = value;
        try {
            callback(element);
        }
        catch(e) {

        }
    });
}

function forEachViewportAll(callback) {

    var elements = elements = $('div.active').find('.viewport')

    $.each(elements, function(index, value) {
        var element = value;
        try {
            callback(element);
        }
        catch(e) {

        }
    });
}